/****** Object:  Stored Procedure dbo.spr_InsertDBOrders  ******/

 use [TourIS]
 GO

 if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[spr_InsertDBOrders]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
 drop procedure [dbo].[spr_InsertDBOrders]
 GO

 SET QUOTED_IDENTIFIER OFF
 GO
 SET ANSI_NULLS OFF
 GO

 CREATE  PROCEDURE [dbo].[spr_InsertDBOrders]
 (
	@clientid int,
	@compid int,
	@fromdate smalldatetime,
	@orderdate smalldatetime,
	@orderid int,
	@todate smalldatetime
 )
 AS

 BEGIN
	SET NOCOUNT ON
	DECLARE @Err int

	INSERT INTO [Orders]
	(
		[ClientId],
		[CompId],
		[FromDate],
		[OrderDate],
		[OrderId],
		[ToDate]
	)
	VALUES
	(
		@clientid,
		@compid,
		@fromdate,
		@orderdate,
		@orderid,
		@todate
	)

	SET @Err = @@Error
	RETURN @Err
 END

 GO

 SET QUOTED_IDENTIFIER OFF
 GO
 SET ANSI_NULLS ON
 GO

